﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class sysadmin_Menu : PowerCreator.LMS.Web.Base.WebBasePage
{
    private PowerCreator.LMS.Web.DL.User.LoginEntity login = new PowerCreator.LMS.Web.DL.User.LoginEntity();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            InitPage();
        }
    }
    protected override void InitPage()
    {
        btn_out.Text = GetLanageValueByKey("SignOut", PowerCreator.LMS.Language.LanagetItemType.WebTitle);
        btn_web.Text = GetLanageValueByKey("btn_weblogin", PowerCreator.LMS.Language.LanagetItemType.WebTitle);
        base.InitPage();
    }
    protected void lnkbtnEn_Click(object sender, EventArgs e)
    {
        Session[PowerCreator.LMS.Web.Config.WebConfig.SESSION_USER_LANGEID] = "1";
        InitPage();
    }
    protected void lnkbtnCn_Click(object sender, EventArgs e)
    {
        Session[PowerCreator.LMS.Web.Config.WebConfig.SESSION_USER_LANGEID] = "0";
        InitPage();
    }
    protected void btn_out_Click(object sender, EventArgs e)
    {
        PowerCreator.LMS.Web.User.User opUser = new PowerCreator.LMS.Web.User.User();
        if (Session[PowerCreator.LMS.Web.Config.WebConfig.SESSION_USER_USERINFO] != null)
        {
            login = (PowerCreator.LMS.Web.DL.User.LoginEntity)Session[PowerCreator.LMS.Web.Config.WebConfig.SESSION_USER_USERINFO];
            if (login != null)
                opUser.UpdateOnlineUserByUserID(login.VOAdvancedUser.AUser_Id, 1);
        }

        Session.Abandon();

        PowerCreator.LMS.Common.Script.Script.RedirectNewUrl("Login.aspx");
    }
    protected void btn_web_Click(object sender, EventArgs e)
    {
        string url = PowerCreator.LMS.Web.Config.WebConfig.GetDefaultUrl();
        PowerCreator.LMS.Common.Script.Script.NewOpenURL(url);
    }
}
